xend: Greater verbosity on domain creation failure
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 31 Aug 2009 09:12:10 +0000 (10:12 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 31 Aug 2009 09:12:10 +0000 (10:12 +0100)
Attached patch makes error reporting more verbose when
xc.domain_create() fails or raises an Exception.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
tools/python/xen/xend/XendDomainInfo.py

index 5e634b3e2b97c1722c010048af02c10c72e69f7f..f5c9bdac94ed42f9ae842ab2a10a15bef953995b 100644 (file)
@@ -2408,10 +2408,13 @@ class XendDomainInfo:
             # may get here if due to ACM the operation is not permitted
             if security.on() == xsconstants.XS_POLICY_ACM:
                 raise VmError('Domain in conflict set with running domain?')
+            log.exception(e)
 
-        if self.domid < 0:
-            raise VmError('Creating domain failed: name=%s' %
-                          self.info['name_label'])
+        if not self.domid or self.domid < 0:
+            str = 'Creating domain failed: name=%s' % self.info['name_label']
+            if self.domid:
+                str += ', error=%i' % int(self.domid)
+            raise VmError(str)
 
         self.dompath = GetDomainPath(self.domid)